package com.kangfawei.io;

import java.io.*;

/**
 * @author
 * 将字节流转换成字符流进行处理（仅限纯文本）
 */
public class ConvertTest {
    public static void main(String[] args) {
        try(BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
            BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out))) {
//            读取键盘输入然后输出
            String msg = "";
            while(!"exit".equals(msg)){
                msg = reader.readLine(); // 读取一行
                writer.write(msg);
                writer.newLine();
            }
            writer.flush();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
